<template>
  <div class="server-main">
    <div class="server-table">
      <div class="item-list-warpper">
        <el-table
          :data="modelList"
          class="km-table"
        >
          <el-table-column
            type="index"
            label="序号"
            width="50"
            align="center"
          ></el-table-column>
          <el-table-column
            prop="modelCode"
            label="模型编码"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="modelName"
            label="模型名称"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="tableName"
            label="表名"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
          <el-table-column
            prop="baseName"
            label="目标数据库"
            align="center"
            show-overflow-tooltip
          ></el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "relationalPhysicalModel",
  components: {},
  props: {
    logicalModelId: {
      type: Number,
      value: 0,
    },
  },
  data: () => {
    return {
     modelList:[]
    };
  },
  created(){
      this.getPhysicList(this.logicalModelId);
  },
  methods:{
      //获取关联物理模型列表
    getPhysicList(ID) {
        console.log(this.logicalModelId);
      let id = ID || -1;
      this.$axios
        .post( `${this.$api.modelDesign.physicModel.beLinkedPhysicalModel}?logicalModelId=${id}`)
        .then((res) => {
          let data = res.data.data;
          this.modelList = data;
        })
        .catch((err) => {
          console.log(err);
          this.$message.error(err.data.message);
        });
    },
  }
}
</script>

